public class nrtd {
    public static void main(String[] args) {
        int[] height = new int[10];
        int left = 0,right = height.length -1,ret = 0;
        while(left < right){
int v = Math.min(height[left],height[right])*(right-left);
ret = Math.max(ret,v);
if(height[left]<height[right]) left++;
else right--;
        }
        return ret;
    }
}
